
<%
  String Msg;

  String CookieName = request.getParameter("CookieName");
  String CookieValue = request.getParameter("CookieValue");

  if((CookieName!=null)&&(!CookieName.equals("")))
  {
    if((CookieValue!=null)&&(!CookieValue.equals("")))
    {
      Cookie c = new Cookie(CookieName, CookieValue);
      response.addCookie(c);
      Msg = "Cookie successfully created.";
    }
    else
    {
      Msg = "cookie value field is empty";
    }
  }
  else
  {
    Msg = "cookie name field is empty.";
  }
%>
<html>
<head>
<title>Using response Impilict Object </title>
</head>
<P><%=Msg %></P>
<P>Click back in your browser to view previous form, select refresh and see
if your new cookie has indeed been created.</P>
<hr>
</body>
</html>
